#include "logprint.h"

namespace minic {

#include <sstream>
#include <ctime>
#include <chrono>
#include <iomanip>
std::string getNowStr() {
    auto now = std::chrono::system_clock::now();
    auto now_time_t = std::chrono::system_clock::to_time_t(now);
    std::tm local_time;
    localtime_r(&now_time_t, &local_time);
    auto duration_since_epoch = now.time_since_epoch();
    auto millsec = std::chrono::duration_cast<std::chrono::milliseconds>(duration_since_epoch).count() / 1000;
    std::ostringstream oss;
    oss << std::put_time(&local_time, "%Y-%m-%d %H:%M:%S");
    oss << "." << std::setfill('0') << std::setw(3) << millsec;
    return oss.str();
}


}